package start;


import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Paint;
import java.awt.color.*;
import javax.swing.*;

public class testing extends JPanel{ 
	
	private static final Color GRADIENT_COLOR2 = Color.white;
	private static final float X2 = 50;
	private static final float Y2 = 50;
	
	
	public testing()
	{
		int dim = 150;
		Panel.setBorder(BorderFactory.createEmptyBorder(dim, dim,
				dim, dim));
	}
	
	private JPanel Panel = new JPanel() 
	{
		
		@Override
		
		protected void paintComponent(Graphics graphix) 
		{
			super.paintComponent(graphix);

			Paint paint = new GradientPaint(0f, 0f, Color.BLUE, X2, Y2,
					GRADIENT_COLOR2, true);
			Graphics2D graphix2 = (Graphics2D) graphix;
			graphix2.setPaint(paint);
			graphix2.fillRect(0, 0, getWidth(), getHeight());
		}
	};

	  
	  public JComponent getComponent() 
	  {
			return Panel;
	  }
	  
	  private static void createAndShowUI() {
			JFrame frame = new JFrame("test");
			frame.getContentPane().add(new testing().getComponent());
			frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			frame.pack();
			frame.setLocationRelativeTo(null);
			frame.setVisible(true);
		}

		public static void main(String[] args) {
			java.awt.EventQueue.invokeLater(new Runnable() {
				public void run() {
					createAndShowUI();
				}
			});
		}

	

}
